﻿<%@ Page Language="C#" MasterPageFile="~/MPage.Master" AutoEventWireup="true" CodeBehind="CartDetail.aspx.cs" Inherits="KTSonline.CartDetail" Title="KTS online - Giỏ hàng" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="js/cart.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div id="left">
        <div id="banner">
            <a href="#"><img src="images/banner/banner_top.png" alt="banner" /></a>
        </div>
        <div class="bortop">
        </div>
        <div class="borleft">
            <div class="borright">
                <div class="content">
                    <div class="title">Chi tiết giỏ hàng</div>
                    <div class="padding">
                        <div id="cartdetail">
                            <table cellpadding="5" cellspacing="0" id="tblCart">
                                <tbody>
                                    <tr class="cartHeader">
                                        <th>STT</th>
                                        <th>Tên sản phẩm</th>
                                        <th>Loại sản phẩm</th>
                                        <th>Đơn giá</th>
                                        <th>SL</th>
                                        <th>Thành tiền</th>
                                        <th></th>
                                    </tr>
                                    <asp:Repeater ID="Repeater1" runat="server">
                                        <ItemTemplate>
                                            <tr class="row">
                                                <td class="cen"><%#(((RepeaterItem)Container).ItemIndex + 1).ToString() %></td>
                                                <td><%# Eval("name") %></td>
                                                <td><%# Eval("category") %></td>
                                                <td class="right"><%# Eval("price", "{0:N0}") %></td>
                                                <td class="cen"><input type="text" id="cartqty<%#Eval("id") %>" value="<%# Eval("quantity", "{0:N0}")%>" maxlength="3" size="2" onkeyup="updateQTY(this)" /></td>
                                                <td class="right"><%# getTotal(Eval("quantity"), Eval("price"))%></td>
                                                <td><a href="JavaScript:CartFunc('<%#Eval("id") %>', 5)">Delete</a></td>
                                            </tr> 
                                        </ItemTemplate>
                                        <AlternatingItemTemplate>
                                            <tr class="altrow">
                                                <td class="cen"><%#(((RepeaterItem)Container).ItemIndex + 1).ToString() %></td>
                                                <td><%# Eval("name") %></td>
                                                <td><%# Eval("category") %></td>
                                                <td class="right"><%# Eval("price", "{0:N0}")%></td>
                                                <td class="cen"><input type="text" id="cartqty<%#Eval("id") %>" value="<%# Eval("quantity", "{0:N0}")%>" maxlength="3" size="2" onkeyup="updateQTY(this)"/></td>
                                                <td class="right"><%# getTotal(Eval("quantity"), Eval("price")) %></td>
                                                <td><a href="JavaScript:CartFunc('<%#Eval("id") %>', 5)">Delete</a></td>
                                            </tr>
                                        </AlternatingItemTemplate>
                                    </asp:Repeater>
                                    <tr class="cartFooter">
                                        <th colspan="4" class="right">Tổng cộng</th>
                                        <th class="cen"><%= cart.quantity.ToString("N0") %></th>
                                        <th class="right"><%= cart.totalprice.ToString("N0")%></th>
                                        <th colspan="2"></th>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <%  if (tk == null)
                            {%>
                        <p class="notice">Vui lòng nhập thông tin đặt hàng hoặc <a href="Javascript:gotoLogin()">Đăng nhập</a></p>
                        <%} %>
                        <fieldset class="fieldset">
                            <legend class="legend">Thông tin người nhận</legend>
                            <ul class="DInfo">
                                <li>
                                    <p>
                                        <asp:Label AssociatedControlID="DName" Text="Tên người nhận" runat="server"></asp:Label>
                                        <asp:TextBox ID="DName" runat="server" name="DName"></asp:TextBox>
                                        <span class="error hide">Vui lòng nhập tên người nhận</span>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                            ErrorMessage="" ControlToValidate="DName"></asp:RequiredFieldValidator>
                                    </p>
                                </li>
                                <li>
                                    <p>
                                        <asp:Label AssociatedControlID="DPhone" Text="Số điện thoại" runat="server"></asp:Label>
                                        <asp:TextBox ID="DPhone" runat="server" name="DName"></asp:TextBox>
                                        <span class="error hide">Vui lòng nhập số điện thoại người nhận</span>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                            ErrorMessage="" ControlToValidate="DPhone"></asp:RequiredFieldValidator>
                                    </p>
                                </li>
                                <li>
                                    <p>
                                        <asp:Label AssociatedControlID="DEmail" Text="Email" runat="server"></asp:Label>
                                        <asp:TextBox ID="DEmail" runat="server" name="DEmail"></asp:TextBox>
                                        <span class="error hide">Vui lòng nhập email</span>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                            ErrorMessage="" ControlToValidate="DEmail"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                        ErrorMessage="" ControlToValidate="DEmail" 
                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>    
                                    </p>
                                </li>
                            </ul>
                        </fieldset>
                        <fieldset class="fieldset">
                            <legend class="legend">Thông tin nhận hàng</legend>
                            <ul class="DInfo">
                                <li>
                                    <p>
                                        <asp:Label AssociatedControlID="DAddress" Text="Địa chỉ" runat="server"></asp:Label>
                                        <asp:TextBox ID="DAddress" runat="server" name="DAddress" TextMode="MultiLine"></asp:TextBox>
                                        <label class="error hide" id="eAdd">Vui lòng nhập địa chỉ nhận hàng</label>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                            ErrorMessage="" ControlToValidate="DAddress"></asp:RequiredFieldValidator>
                                    </p>
                                </li>
                                <li>
                                    <p>
                                        <asp:Label AssociatedControlID="DMessage" Text="Lời nhắn đến KTSonline" runat="server"></asp:Label>
                                        <asp:TextBox ID="DMessage" runat="server" name="DMessage" TextMode="MultiLine"></asp:TextBox>
                                    </p>
                                </li>
                            </ul>
                        </fieldset>
                        <fieldset class="fieldset">
                            <legend class="legend">Mã xác nhận</legend>
                            <recaptcha:RecaptchaControl ID="recaptcha" runat="server" style="margin-left:120px;"
                                PublicKey="6Lf0A8kSAAAAAGZnlWqiof5c3T36AkGSsDpB2UUo" 
                                PrivateKey="6Lf0A8kSAAAAAGguEFRNSwrDNobswZKtxCephsd0" Theme="white" Language="en" />
                        </fieldset>

                        <p class="cartbtndone">
                            <asp:Button ID="btndone" class="btndone" runat="server" Text="Hoàn tất" 
                                OnClientClick="return validateAll()" onclick="btndone_Click" />                 
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div class="borbottom">
        </div>
    </div>
</asp:Content>
